class Singleton(type):
    def __call__(cls, *args, **kwargs):
        if hasattr(cls, "__instance"):
            return getattr(cls, "__instance")

        obj = super().__call__(*args, **kwargs)
        setattr(cls, "__instance", obj)
        return obj


class Person(metaclass=Singleton):
    pass


p1 = Person()
p2 = Person()

print(p1 is p2)
